using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using LaughingDog;
using LaughingDog.Input;
using LaughingDog.Managers;
using Microsoft.Xna.Framework.Input;
using LaughingDog.GameObjects;

namespace Demo
{
    public class Game : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;                

        public Game()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
        }

        protected override void Initialize()
        {
            // Initialises the Laughing Dog framework, you are now free to use any of its features.
            Engine.Initialise(this, graphics);

            base.Initialize();
        }

        protected override void LoadContent()
        {
            // Create an input mapping for the QuitGame action.
            InputMapping mapping = InputManager.Instance.AddInputMapping("QuitGame");
            mapping.AddInput(Keys.Escape);            
            mapping.AddInput(LaughingDog.Input.GamePadButtons.Back);

            // Create a controlled camera.
            new ControlledCamera();

            new Sprite("JoJo");
        }

        protected override void UnloadContent()
        {            
        }

        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if(InputManager.Instance.InputJustPressed("QuitGame"))
                this.Exit();

            base.Update(gameTime);
        }
        
        protected override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
        }
    }
}
